//
//  Dc_FTableViewCell.m
//  艾薇贝儿
//
//  Created by dllo on 15/9/7.
//  Copyright (c) 2015年 dllo－－邴鹏超. All rights reserved.
//

#import "Dc_FTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "AppDelegate.h"
#import "FirstViewController.h"

@implementation Dc_FTableViewCell
{
    UIImageView * bofang;
}
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _image=[[UIImageView alloc]initWithFrame:CGRectMake(20*OffWidth, 10*OffHeight, 80*OffWidth, 80*OffHeight)];
        [self.contentView addSubview:_image];
        
        
        
        _label = [[UILabel alloc]initWithFrame:CGRectMake(105*OffWidth, 20*OffHeight,150*OffWidth ,40*OffHeight )];
        [self.contentView addSubview:_label];
        
        
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(105*OffWidth, 65*OffHeight, 150*OffWidth, 25*OffHeight)];
        _nameLabel.font=[UIFont systemFontOfSize:12];
        [self.contentView addSubview:_nameLabel];

        
        bofang=[[UIImageView alloc]initWithFrame:CGRectMake(300*OffWidth, 40*OffHeight, 40*OffWidth, 40*OffHeight)];
        [bofang setImage:[UIImage imageNamed:@"bofang"]];
        [self.contentView addSubview:bofang];
        
//       FirstViewController * first=[[FirstViewController alloc]init];
//        void(^block)(BOOL)=^(BOOL bl){
//            
//            if (bl==YES) {
//                
//                bofang=[[UIImageView alloc]initWithFrame:CGRectMake(300*W, 40*H, 40*W, 40*H)];
//              
//
//                [bofang setImage:[UIImage imageNamed:@"pu"]];
//                [self.contentView addSubview:bofang];
//                
//            }
//        };
//        first.block=block;
//        
        
        
        
//        self.but=[[UIButton alloc]initWithFrame:CGRectMake(300*W, 40*H, 40*W, 40 *H)];
//        
//        [self.but setImage:[UIImage imageNamed:@"bofang"] forState:UIControlStateNormal];
//       
//        [self.contentView addSubview:self.but];
        
    }
    return self;
}

-(void)model:(DcFirstModel *)model{
    _label.text=model.name;
    _nameLabel.text=model.singerName;
      [_image  sd_setImageWithURL:[NSURL  URLWithString:model.picUrl] placeholderImage:[UIImage imageNamed:@"jia.jpg"]];
//    [_image  sd_setImageWithURL:[NSURL URLWithString:model.picUrl]];
}
- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
